import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Swiper } from 'antd-mobile'
export default class componentName extends Component {
  // 14.封装Carousel组件并校验props参数，实现商品详情的走马灯效果
  static propTypes = {
    banners: PropTypes.array.isRequired
  }

  render() {
    // 14.封装Carousel组件并校验props参数，实现商品详情的走马灯效果
    const { banners } = this.props
    return (
      <div>
        <Swiper>
          {
            banners.map((v, i) => {
              return (
                <Swiper.Item key={i}>
                  <img src={v} alt="" height="400"/>
                </Swiper.Item>
              )
            })
          }
        </Swiper>
      </div>
    )
  }
}
